import {http} from '@/utils/http'

interface ResponseType extends Promise<any> {
  data?: object;
  code?: number;
  message?: string;
}

/*
通过用户名获取用户id
*/
export const getFeatures = (params: object): ResponseType => http.request(
  'get',
  '/data/fd/list',
  {params},
)

export const startRealtime = (params:any): ResponseType => http.request(
  'post',
  '/data/real/start',
  { params }
)

export const stopRealtime = (params:any): ResponseType => http.request(
  'post',
  '/data/real/stop',
  { params }
)

export const realtimeControl = (params:any): ResponseType => http.request(
  'post',
  '/device/realtimeControl',
  { data:params }
)

export const onlineControl = (params:any): ResponseType => http.request(
  'post',
  '/device/onlineControl',
  { data:params }
)



export const reboot = (params:any): ResponseType => http.request(
  'post',
  '/data/reboot',
  { params }
)
/**
 * 查询最新的count条地震事件
 */
export const listEarthquakeEvents = (params:any): ResponseType => http.request(
  'get',
  '/data/ti/list',
  { params }
)
/**
 * 根据时间范围查询实时值列表
 */
export const listRealtime = (params:any): ResponseType => http.request(
  'get',
  '/data/wc/list',
  { params }
)


